package net.gdface.sdk.decorator.client;
import java.nio.ByteBuffer;
import net.gdface.sdk.EyeInfo;
import net.gdface.sdk.FAngle;
import net.gdface.sdk.FInt2;
import net.gdface.sdk.FRect;
import net.gdface.thrift.ThriftDecorator;
import net.gdface.thrift.TypeTransformer;
import com.facebook.swift.codec.ThriftStruct;
import com.facebook.swift.codec.ThriftField;
import com.facebook.swift.codec.ThriftField.Requiredness;
/**
 * decorator pattern 装饰者模式client端代理{@link net.gdface.sdk.CodeInfo}<br>
 * 代理对象必须有默认构造方法,必须是普通类型,不可以有@ThriftStruct注释<br>
 * 转发所有{@link net.gdface.sdk.CodeInfo}get/set方法到{@link #delegate()}指定的实例,<br>
 * 计算机生成代码(generated by automated tools ThriftServiceDecoratorGenerator @author guyadong)<br>
 * @author guyadong
 *
 */
@ThriftStruct
public final class CodeInfo implements ThriftDecorator<net.gdface.sdk.CodeInfo> {
    private final net.gdface.sdk.CodeInfo delegate;
    
    public CodeInfo(){
        this(new net.gdface.sdk.CodeInfo());
    }
    public CodeInfo(net.gdface.sdk.CodeInfo delegate) {
        if(null == delegate){
            throw new NullPointerException("delegate is null");
        }
        // 检查被装饰类是否有@ThriftStruct注释
        if(delegate.getClass().isAnnotationPresent(ThriftStruct.class)){
            throw new IllegalArgumentException(
                String.format("NOT ALLOW %s have @ThriftStruct annotation",delegate.getClass().getName()));
        }
        this.delegate = delegate;
    }

    /**
     * 返回被装饰的{@link net.gdface.sdk.CodeInfo}实例
     * @return
     */
    @Override
    public net.gdface.sdk.CodeInfo delegate() {
        return delegate;
    }
    @Override
    public int hashCode() {
        return delegate().hashCode();
    }
    @Override
    public boolean equals(Object obj) {
        return delegate().equals(obj);
    }
    @Override
    public String toString() {
        return delegate().toString();
    }
    @ThriftField(value = 1,requiredness=Requiredness.OPTIONAL)
    public net.gdface.sdk.decorator.client.FAngle getAngle(){
        return TypeTransformer.getInstance().to(
                    delegate().getAngle(),
                    FAngle.class,
                    net.gdface.sdk.decorator.client.FAngle.class);
    }
    
    @ThriftField
    public void setAngle(net.gdface.sdk.decorator.client.FAngle value){
        delegate().setAngle(TypeTransformer.getInstance().to(
                    value,
                    net.gdface.sdk.decorator.client.FAngle.class,
                    FAngle.class));
    }

    @ThriftField(value = 2,requiredness=Requiredness.OPTIONAL)
    public byte[] getCode(){
        return delegate().getCode();
    }
    
    @ThriftField
    public void setCode(byte[] value){
        delegate().setCode(value);
    }

    @ThriftField(value = 3,requiredness=Requiredness.OPTIONAL)
    public net.gdface.sdk.decorator.client.EyeInfo getEi(){
        return TypeTransformer.getInstance().to(
                    delegate().getEi(),
                    EyeInfo.class,
                    net.gdface.sdk.decorator.client.EyeInfo.class);
    }
    
    @ThriftField
    public void setEi(net.gdface.sdk.decorator.client.EyeInfo value){
        delegate().setEi(TypeTransformer.getInstance().to(
                    value,
                    net.gdface.sdk.decorator.client.EyeInfo.class,
                    EyeInfo.class));
    }

    @ThriftField(value = 4,requiredness=Requiredness.OPTIONAL)
    public byte[] getFacialData(){
        return delegate().getFacialData();
    }
    
    @ThriftField
    public void setFacialData(byte[] value){
        delegate().setFacialData(value);
    }

    @ThriftField(value = 5,requiredness=Requiredness.OPTIONAL)
    public net.gdface.sdk.decorator.client.FInt2 getMouth(){
        return TypeTransformer.getInstance().to(
                    delegate().getMouth(),
                    FInt2.class,
                    net.gdface.sdk.decorator.client.FInt2.class);
    }
    
    @ThriftField
    public void setMouth(net.gdface.sdk.decorator.client.FInt2 value){
        delegate().setMouth(TypeTransformer.getInstance().to(
                    value,
                    net.gdface.sdk.decorator.client.FInt2.class,
                    FInt2.class));
    }

    @ThriftField(value = 6,requiredness=Requiredness.OPTIONAL)
    public net.gdface.sdk.decorator.client.FInt2 getNose(){
        return TypeTransformer.getInstance().to(
                    delegate().getNose(),
                    FInt2.class,
                    net.gdface.sdk.decorator.client.FInt2.class);
    }
    
    @ThriftField
    public void setNose(net.gdface.sdk.decorator.client.FInt2 value){
        delegate().setNose(TypeTransformer.getInstance().to(
                    value,
                    net.gdface.sdk.decorator.client.FInt2.class,
                    FInt2.class));
    }

    @ThriftField(value = 7,requiredness=Requiredness.OPTIONAL)
    public net.gdface.sdk.decorator.client.FRect getPos(){
        return TypeTransformer.getInstance().to(
                    delegate().getPos(),
                    FRect.class,
                    net.gdface.sdk.decorator.client.FRect.class);
    }
    
    @ThriftField
    public void setPos(net.gdface.sdk.decorator.client.FRect value){
        delegate().setPos(TypeTransformer.getInstance().to(
                    value,
                    net.gdface.sdk.decorator.client.FRect.class,
                    FRect.class));
    }

}